package com.young.netty.gateway.context;

import io.netty.buffer.ByteBuf;
import io.netty.handler.codec.http.HttpHeaders;
import io.netty.handler.codec.http.HttpMethod;

/**
 * 后端上下文
 *
 * @author Young
 * @Date 2021-07-24 19:26
 */
public class BackendContext {
    /**
     * 请求方法
     */
    private HttpMethod method;

    /**
     * 请求地址
     */
    private String url;

    /**
     * 请求内容
     */
    private ByteBuf requestContent;

    /**
     * 请求header
     */
    private HttpHeaders requestHeaders;

    /**
     * 响应headers
     */
    private HttpHeaders responseHeaders;

    /**
     * 响应内容
     */
    private ByteBuf responseByteBuf;

    public HttpMethod getMethod() {
        return method;
    }

    public void setMethod(HttpMethod method) {
        this.method = method;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public ByteBuf getRequestContent() {
        return requestContent;
    }

    public void setRequestContent(ByteBuf requestContent) {
        this.requestContent = requestContent;
    }

    public HttpHeaders getRequestHeaders() {
        return requestHeaders;
    }

    public void setRequestHeaders(HttpHeaders requestHeaders) {
        this.requestHeaders = requestHeaders;
    }

    public HttpHeaders getResponseHeaders() {
        return responseHeaders;
    }

    public void setResponseHeaders(HttpHeaders responseHeaders) {
        this.responseHeaders = responseHeaders;
    }

    public ByteBuf getResponseByteBuf() {
        return responseByteBuf;
    }

    public void setResponseByteBuf(ByteBuf responseByteBuf) {
        this.responseByteBuf = responseByteBuf;
    }
}
